package com.ipad.ui;

import android.support.v4.app.Fragment;

/**
 * Created by Administrator on 2018/12/3.
 */

public abstract class LazyFragment extends Fragment {
    public boolean isVisiable = false;


    @Override
    public void setUserVisibleHint(boolean isVisibleToUser) {
        super.setUserVisibleHint(isVisibleToUser);
        if (getUserVisibleHint()) {
            onLazyLoad();
            isVisiable = true;
        } else {
            isVisiable = false;
        }

    }

    public abstract void onLazyLoad();
}
